/*
*************************************
* PocketGTT
*************************************
This file is part of PocketGTT.

PocketGTT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PocketGTT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PocketGTT.  If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 1.0


Item {



//    Flipable {
//        id: txtflip
//        anchors.fill: parent

//        front:

    Rectangle {
        id: mov_bg
        width: txtpas.width*1.4 //parent.width / 4
        height: parent.height *.7

        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.horizontalCenterOffset: -parent.width / 4

        radius: height / 3
        color: myWin.theme.violet_background
    }

    Item {
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.horizontalCenterOffset: -parent.width / 4

            Text {
            id: txtpas
            text: "Passaggi"
            font.pixelSize: myWin.theme.textSizeM  //10
            font.bold: true
            color: "#1f1f1f"

            anchors.centerIn: parent
            //            anchors.verticalCenter: parent.verticalCenter
            //            anchors.horizontalCenter: parent.horizontalCenter
            //        anchors.horizontalCenterOffset: - (30 + (parent.width/2 - 30) /2)
            //            anchors.horizontalCenterOffset: - (parent.width / 2.8)

        }
    }

//        back:
    Item {
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.horizontalCenterOffset: parent.width / 4
            Text {
            id: txtmap
            text: "Mappa"
            font.pixelSize: myWin.theme.textSizeM //10
            font.bold: true
            color: myWin.theme.violet_background

            anchors.verticalCenter: parent.verticalCenter
            anchors.horizontalCenter: parent.horizontalCenter
            //            anchors.horizontalCenterOffset: (parent.width / 2.8)
        }
    }



        states: State {
            name: "map"
            PropertyChanges { target: mov_bg; anchors.horizontalCenterOffset: parent.width / 4 }
            PropertyChanges { target: txtpas; color:  myWin.theme.violet_background}
            PropertyChanges { target: txtmap; color: "#1f1f1f" }
            when: myWin.statesMan.pageview_map
        }

        transitions: Transition {
            NumberAnimation { target: mov_bg; property: "anchors.horizontalCenterOffset"; duration: myWin.theme.changetimeS }
            ColorAnimation { duration: myWin.theme.changetimeS }
        }

//    }
    MouseArea {
        anchors.fill: parent
        onClicked: myWin.statesMan.pageview_map = !myWin.statesMan.pageview_map
    }
}
